home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / neuron.zip / NETWORK.DOC < prev    next >
Text File  |  1992-07-06  |  5KB  |  91 lines

  1. *********************************************************************
  2.                             NETWORK.DOC
  3. *********************************************************************
  4. VERSION 2.5     E.FARHI     07/92       TC 2.0
  5.  
  6. This is a short doc file for NETWORK.C
  7. Read it carefully, it explains how to make and use a network.
  8. You should have already read THEORY.DOC....
  9.  
  10. I shall tell you about local procedures and using NEURON.C .
  11.  
  12. ***  Local procedures
  13.  
  14. print_output(net)
  15.         Prints the last layer state.
  16. vector_modify(vector,size,high,low)
  17.         Modifies a vector containing some binary data (0 and 1) into a vector 
  18.         containing low and high states, in order to send it to the net.
  19. sort(vector,order,size)
  20.         Sorts a vector and sends back the sorting order.
  21. print_input(Xmax,Ymax,input)
  22.         Prints the input as a Xmax*Ymax array (for caracters).
  23. print_result(net)
  24.         Sorts and prints the network answer (output layer).
  25.         Gives the network identification of a caracter.
  26. init_std_network(net)
  27.         Standart init of a net. If you don't want to think of how to initialize 
  28.         a net...The network is then a multi-preceptron one.
  29. learn(...)
  30.         Supervized learning using optimization algorithm.
  31. verify(...)
  32.         Verifies that the net has a good memory.
  33.  
  34. *** How do I build my network.
  35.  
  36.         First of all, you need to define your network size. For this initialize 
  37. nb_layers, nb_n_layer, nb_levels, layer_order. If you want to understand how 
  38. the layer order works, see NEURON.DOC.
  39.         Then, you need to set the prototypes. Each prototype is associated to 
  40. an output neuron (a neuron for each class). In the given example, the input isa 
  41. 5*7 array, and the output, the alphabet.
  42.  
  43.         You allocate memory and prepare the prototypes with vector_modify.
  44.         To teach the network, the only thing to do is to run 'learn_opt'.
  45.  
  46.         Some disk utilities are available, and I even show how to recognize a 
  47. 'strange' 'V' (not too strange). Finally, the network gives its answer...
  48.  
  49. *** Some advice. (see 'init_std_network')
  50.  
  51.         I use a three precepton network because it can learn many things, and 
  52. computation is fast. The answering time is also quick. On the contrary, an 
  53. Hopfield net is slow (because it needs to stabilize) and can't memorize too 
  54. many things. A {0,1,2} order is fine.
  55.         The simulated tempering is useful when the net has difficulties to 
  56. learn, especially for Hopfield layers, because it enables to avoid interference 
  57. states created during the learning. You can decide of the tempering 
  58. temperatures and the exponential decreasing constant. If that constant is too 
  59. small, the learning time becomes very important.
  60.         The error threshold defines the learning depth. If it's high, the 
  61. learning is quick but the network doesn't know very well the prototypes at the 
  62. end. If it's low, learning time is longer, and the net has a good memory. 
  63. Anyway, it has been shown that a too small threshold doesn't fit well with the 
  64. generalization capacity. A net too specialized in what it has learnt can't 
  65. extrapolate its knowledge to unknown prototypes. That's why a 5 % to 10 % error 
  66. threshold is enough
  67.         The network temperature is a variable important. Finding an optimal 
  68. value is difficult. I use a value between 0.1 and 10 (why not 1), except during 
  69. tempering.
  70.         The improving variation coefficient for modifying links during 
  71. backpropagation can't be too high, else the network oscillates, even with the 
  72. shaker algorithm. Theorically, a high value decreases the learning time.. So 
  73. it's better too have a longer learning, but to be sure that the net will learn 
  74. something ! It depends of temperature. With beta=1/T=0.3 I use coef=0.3 .
  75.         If you use (as I do) continuum neurons, the high and low state can't be 
  76. reached because of the sigmoid shape (to reach those value, the potentials have 
  77. to be infinite, what leads to network saturation). So, for the learning 
  78. procedure, you have to impose some lower states in the outputs. That's why 
  79. coef_out is not 1 but 0.9 , then outputs are reachable.
  80.         The links and potential thresholds have to be used, to avoid the net 
  81. overflow. If the link threshold is low, the net can't memorize everything, and 
  82. will prefer to forget old prototypes, ad to learn the new ones. The bascule 
  83. threshold is generally 0 (else it causesa disymetry).
  84.         The random noise enables the net to avoid interference states. 5 % to 
  85. 10 % is good.
  86.         the high and low states are usually +1 and -1. (0 and +1 is also 
  87. possible)
  88.  
  89.         Anyway, to understand better this, you should have a look to the 
  90. 'init_std_network' procedure in NETWORK.C .
  91.